import { ratedApi } from "@/utils/api";
// 首页模块
const indexModule = {
  namespaced: true,
  state: {
    // 最受欢迎列表
    ratedList: [],
  },
  mutations: {
    getRatedList(state, payload) {
      state.ratedList = payload.result;
    },
  },
  actions: {
    getRatedListAsync({ commit }) {
      return new Promise((resolve) => {
        ratedApi().then((res) => {
          commit("getRatedList", res);
          resolve();
        });
      });
    },
  },
};

export default indexModule;
